//
//  MyEmblemThreeCell.m
//  ShangHaiTuJI
//
//  Created by xiaoxiangtuji on 2017/10/22.
//  Copyright © 2017年 xiaoxiangtuji. All rights reserved.
//

#import "MyEmblemThreeCell.h"

@implementation MyEmblemThreeCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _pictuerImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:_pictuerImageView];
        [_pictuerImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.contentView.mas_centerY);
            //            make.top.equalTo(self.contentView.mas_top).offset(15);
            //            make.bottom.equalTo(self.contentView.mas_bottom).offset(-20);
            make.left.equalTo(self.contentView.mas_left).offset(scaleLeftAndRight(25));
                make.size.mas_equalTo(CGSizeMake(scaleLeftAndRight(85), scaleTopAndBottom(54)));
            
        }];
        UIImageView *lineImageView = [[UIImageView alloc] init];
        lineImageView.image = [UIImage imageNamed:@"huizhangxian"];
        [self.contentView addSubview:lineImageView];
        [lineImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.height.mas_equalTo(3);
            make.centerX.mas_equalTo(_pictuerImageView.mas_centerX);
            make.width.mas_equalTo(scaleLeftAndRight(40));
            make.bottom.equalTo(self.contentView.mas_bottom).offset(scaleTopAndBottom(-2));
        }];
        _titleLabel = [[UILabel alloc] init];
        _titleLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:_titleLabel];
        [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(_pictuerImageView.mas_right).offset(scaleLeftAndRight(20));
            make.top.equalTo(self.contentView.mas_top).offset(scaleLeftAndRight(40));
            make.height.mas_equalTo(scaleTopAndBottom(20));
            make.right.equalTo(self.contentView.mas_right).offset(scaleLeftAndRight(-10));
        }];
        _integraLabel = [[UILabel alloc] init];
        _integraLabel.font = [UIFont systemFontOfSize:10];
        _integraLabel.textColor = COLOR_HEX(0x999999);
        [self.contentView addSubview:_integraLabel];
        [_integraLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(_pictuerImageView.mas_right).offset(scaleTopAndBottom(20));
            make.top.equalTo(self.titleLabel.mas_bottom);
            make.height.mas_equalTo(scaleTopAndBottom(20));
            make.right.equalTo(self.contentView.mas_right).offset(scaleLeftAndRight(-10));
        }];
        _minLabel = [[UILabel alloc] init];
        _minLabel.font = [UIFont systemFontOfSize:12];
        _minLabel.textAlignment = NSTextAlignmentRight;
        _minLabel.textColor = COLOR_HEX(0x767676);
        [self.contentView addSubview:_minLabel];
        [_minLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.pictuerImageView.mas_right).offset(scaleLeftAndRight(20));
            make.top.equalTo(_integraLabel.mas_bottom).offset(scaleTopAndBottom(5));
            make.height.mas_equalTo(scaleTopAndBottom(15));
            make.width.mas_equalTo(scaleLeftAndRight(40));
        }];
        _maxLabel = [[UILabel alloc] init];
        _maxLabel.font = [UIFont systemFontOfSize:12];
        _maxLabel.textColor = COLOR_HEX(0x767676);
        [self.contentView addSubview:_maxLabel];
        [_maxLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self.contentView).offset(-5);
            make.top.equalTo(_integraLabel.mas_bottom).offset(5);
            make.height.mas_equalTo(15);
            make.width.mas_equalTo(40);
        }];
        _progressView = [[UIProgressView alloc] init];
        [self.contentView addSubview:_progressView];
        [_progressView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(_minLabel.mas_right).offset(scaleLeftAndRight(5));
            make.right.equalTo(_maxLabel.mas_left).offset(scaleLeftAndRight(-5));
            make.top.equalTo(_integraLabel.mas_bottom).offset(scaleTopAndBottom(12));
            make.height.mas_equalTo(1);
        }];
        _minLabel.text = @"1000";
        _maxLabel.text = @"2000";
        _integraLabel.text = @"当个人积分达到400点点亮徽章";
        _titleLabel.text = @"小海豚";
    }
    return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
